package com.weixx.service;

import com.weixx.dao.BookMapper;
import com.weixx.pojo.Books;

import java.util.List;

/**
 * @Auther weixx
 * @Date 2022/1/11
 */
public class BookServiceImp implements BookSercice{
    //Service掉DAO层
    private BookMapper bookMapper;
    //为了注入
    public BookMapper getBookMapper() {
        return bookMapper;
    }

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int addBook(Books bks) {
        return bookMapper.addBook(bks);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int updateBook(Books bks) {
        return bookMapper.updateBook(bks);
    }

    @Override
    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    @Override
    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }

    @Override
    public List<Books> queryBookByName(String name) {
        return bookMapper.queryBookByName(name);
    }
}
